package com.lsu.app.bean;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;

import java.io.Serializable;

import java.time.LocalDateTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;

/**
 * 点赞表
 * @Date 2023-10-27 11:01:33
 * @author hjj
 */
@Data
@TableName("praise")
@ApiModel(value="Praise对象", description="点赞表")
public class Praise implements Serializable {

    @ApiModelProperty("")
    private Integer id;

    @ApiModelProperty("#点赞类所属的用户id")
    private Integer teacherId;

    @JsonIgnore  //数据库中不会输出该字段到json中
    @ApiModelProperty("用户id")
    private Integer userId;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("用户昵称")
    private String name;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("点赞类型")
    private String typeName;

    @NotNull(message="[点赞类型（1评论，2教师，3课程，4课程视频）]不能为空")
    @ApiModelProperty("点赞类型（1评论，2教师，3课程，4课程视频）")
    private Integer type;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("目的名称")
    private String targetName;

    @JsonIgnore  //数据库中不会输出该字段到json中
    @ApiModelProperty("目的id")
    private Integer targetId;

    @ApiModelProperty("创建时间")
    private String createTime;

    public Praise() {
    }

    public Praise(Integer type) {
        this.type = type;
    }

    public Praise(Integer teacherId,Integer userId, String name, String typeName, Integer type, String targetName, Integer targetId,String createTime) {
        this.userId = userId;
        this.teacherId=teacherId;
        this.name = name;
        this.typeName = typeName;
        this.type = type;
        this.targetName = targetName;
        this.targetId = targetId;
        this.createTime=createTime;
    }
}
